package com.demo.flightInfo;

import com.jfinal.core.Controller;
import com.jfinal.validate.Validator;

public class FlightSearchValidator extends Validator {

	@Override
	protected void validate(Controller c) {
		validateRegex("fno", "[a-zA-Z0-9]{2}[0-9]{3,4}", "fnoMsg", "航班号输入有误");
	}

	@Override
	protected void handleError(Controller c) {
		c.keepPara("fno");
		c.render("/index/index.html");
	}

}
